<?php

namespace App\Http\Controllers\Member;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Member\Good;
use App\Models\Member\GoodPrice;
use App\Common\AliossHandler;
use Auth;

class GoodController extends Controller
{
    public function getType()
    {
        $good = new Good;
        $data = $good->getType();

        return self::successClient($data, '商品类别数据获取成功');
    }

    public function getMall(Request $request)
    {
        $typeId = $request['good_type_id'];
        $word = $request['word'];
        $good = new Good;
        $data = $good->getMall($typeId, $word);

        return self::successClient($data, '商品数据获取成功');
    }

    //爆单产品
    public function getHot(Request $request)
    {   
        $type = $request['type'];
        $good = new Good;
        $data = $good->getHot($type);

        return self::successClient($data, '爆单商品数据获取成功');
    }

    public function getDetail(Request $request)
    {
        $id = $request['id'];
        $good = new Good;
        $data = $good->getDetail($id);

        return self::successClient($data, '商品数据获取成功');
    }
}
